package xiaomi;

import java.util.Arrays;
import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        int result = 2;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] a = new int[n];
        int index = 0;
        while (index<n) {
            a[index++] = sc.nextInt();
        }
        if (a[n-1]-a[0]+1<=k) {
            System.out.println(result);
            return;
        }

        int[] newArray1 = new int[n+1];
        newArray1[0] = 0;
        System.arraycopy(a, 0, newArray1, 1, n);
        int[] distanceArray = new int[n];
        for(int i=1; i<n+1; i++) {
            distanceArray[i-1] = newArray1[i]-newArray1[i-1]-1; // 这里上山注意，如果两天为例如2-3，那么其中间隔是0天
        }
        Arrays.sort(distanceArray);
        int distance = a[n-1]-a[0]-k;
        for(int i=n-1; i>=0; i--) {
            result += 2;
            distance -= distanceArray[i];
            if(distance <= 0) {
                System.out.println(result);
                return;
            }
        }

    }
}
